<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%-- Uncomment below lines to add portlet taglibs to jsp
<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>

<portlet:defineObjects />
<%PortletPreferences prefs = renderRequest.getPreferences();%> 
--%>
<script type="text/javascript" src="${pageContext.request.contextPath}/OpenLayers-2.8/OpenLayers.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/js/jquery-ui-1.7.2.custom.min.js"></script>
<link type="text/css" href="${pageContext.request.contextPath}/jquery/css/cupertino/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
<style type="text/css">
    .map {
        width: 100%;
        height: 500px;
        border: 1px solid black;
    }
</style>

<div id="searchform" class="ui-widget-content ui-corner-all">
    <form action="#" onsubmit="findLoc($('#kw').val());return false;">
        Search: <input type="text" class="ui-widget-content ui-corner-all" id="kw">
        <input type="submit" value="Search" class="ui-widget-content ui-corner-all">
    </form>
    <div id="searchresult" style="max-height:300px;width:400px;overflow:auto"></div>
</div>

<div id="maps">
    <ul>
        <li><a href="#ground">Ground</a></li>
        <li><a href="#floor2">Floor2</a></li>
        <li><a href="#floor3">Floor3</a></li>
        <li><a href="#floor4">Floor4</a></li>
        <li><a href="#floor5">Floor5</a></li>
        <li><a href="#floor6">Floor6</a></li>
        <li><a href="#floor7">Floor7</a></li>
    </ul>
    <div id='ground' class="map"></div>
    <div id='floor2' class="map"></div>
    <div id='floor3' class="map"></div>
    <div id='floor4' class="map"></div>
    <div id='floor5' class="map"></div>
    <div id='floor6' class="map"></div>
    <div id='floor7' class="map"></div>
</div>

<script type="text/javascript">
    $(function() {
        $("#maps").tabs();
    });
</script>

<script type="text/javascript">
var datapath = "${pageContext.request.contextPath}/mapdata/";



function gotoFloor(idx){
    $("#maps").tabs('select',idx);
}

function makeStair(curr){
    if(curr==0){
        return "<br>Would you like to go <a href=\"#\" onclick=\"gotoFloor(1)\">up</a>";
    }else if(curr==6){
        return "<br>Would you like to go <a href=\"#\" onclick=\"gotoFloor(5)\">down</a>";
    }else{
        return "<br>Would you like to go <a href=\"#\" onclick=\"gotoFloor(" + (curr+1) + ")\">up</a> or <a href=\"#\" onclick=\"gotoFloor(" + (curr-1) + ")\">down</a>";
    }
}

function makeElevator(curr){
    f = ["Ground","Floor2","Floor3","Floor4","Floor5","Floor6","Floor7"];
    menu = "<br>Elevator control:<ul>";
    for(i=6;i>=0;i--){
        if(i!=curr)
            menu += "<li>Go to <a href=\"#\" onclick=\"gotoFloor(" + i + ")\">" + f[i] + "</a></li>";
    }
    menu += "</ul>";
    return menu;
}

function displayUpDownMenu(curr, isstair){
    if(isstair==true){
        return makeStair(curr);
    }else{
        return makeElevator(curr);
    }
}


function centerLoc(what){
	var mp = [mapg,mapf2,mapf3,mapf4,mapf5,mapf6,mapf7];	
	if(what.childNodes[2] && what.childNodes[3]){
		tmp = what.childNodes[2].innerHTML;
		if(tmp=="Ground")
			floor = 0;
		else
			floor = parseInt(tmp)-1;
		lonlat = what.childNodes[3].innerHTML;
		ll = OpenLayers.LonLat.fromString(lonlat);
		gotoFloor(floor);
		mp[floor].setCenter(ll);
	}
}

function findLoc(kw){
	var found = 0;
    var resultable = document.createElement("TABLE");
	var tr = document.createElement("TR");
	tr.className = "ui-widget-header ui-corner-all";
	var th1 = document.createElement("TH"); th1.innerHTML = "Name";
	var th2 = document.createElement("TH"); th2.innerHTML = "Description";
	var th3 = document.createElement("TH"); th3.innerHTML = "Floor";
	var th4 = document.createElement("TH"); th4.innerHTML = "Lon,Lat";
	var btnclose = document.createElement("IMG"); btnclose.src = datapath + "Remove-16x16.png";btnclose.alt = "Close";btnclose.title = "Close";
	btnclose.onclick = function(){
		$("#searchresult").html("");
	};
	var th5 = document.createElement("TH"); th5.appendChild(btnclose);
	tr.appendChild(th1);tr.appendChild(th2);tr.appendChild(th3);tr.appendChild(th4);tr.appendChild(th5);
	resultable.appendChild(tr);
    resultable.className="ui-widget-content ui-corner-all";
    var data = [vectorsg.features,vectorsf2.features,vectorsf3.features,vectorsf4.features,vectorsf5.features,vectorsf6.features,vectorsf7.features];	
    for(i=0;i<data.length;i++){
        var features = data[i];
        for(j = 0; j < features.length; j++){
            var f = features[j];
            if((f.attributes.name && f.attributes.name.toLowerCase().contains(kw.toLowerCase())) || (f.attributes.description && f.attributes.description.toLowerCase().contains(kw.toLowerCase()))){
				found ++;
                var tr = document.createElement("TR");
                tr.onmouseover = function(){
                    this.bgColor = "#317082";
                }
                tr.onmouseout = function(){
                    this.bgColor = "";
                }
				centll = f.geometry.getBounds().getCenterLonLat();
				var td3 = document.createElement("TD");
				if(i==0)
					td3.innerHTML = "Ground";
				else
					td3.innerHTML = i + 1;
				var td4 = document.createElement("TD");
				td4.innerHTML = centll.toShortString();
                tr.onclick = function(){
					centerLoc(this);
                }
                var td1 = document.createElement("TD");
                td1.innerHTML = f.attributes.name;
                var td2 = document.createElement("TD");
                td2.innerHTML = f.attributes.description;
				var td5 = document.createElement("TD");
                tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);
                resultable.appendChild(tr);
            }
        }
    }
	if(found==0){
		tr = document.createElement("TR");
		td = document.createElement("TD");
		td.colspan = 4;
		td.innerHTML = "Found no location";
		tr.appendChild(td);
		resultable.appendChild(tr);
	}
    $("#searchresult").html("");
    $("#searchresult").append($(resultable));
}




///
var mapf2,mposctlf2,vectorsf2, geojsonf2,markersk2,selectControlf2;
var selectedFeaturef2;
//Init
mapf2 = new OpenLayers.Map('floor2');
layer = new OpenLayers.Layer.Image(
    "floor2",
    datapath + "floor2.jpg",
    new OpenLayers.Bounds(-1097,-270.5,1097,270.5),
    new OpenLayers.Size(2194,541)
);
mapf2.addLayer(layer);
mapf2.zoomToMaxExtent();
var featurecollection = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_92",
            "properties": {
                "name": "A.202",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1077,
                            249
                        ],
                        [
                            -803,
                            248
                        ],
                        [
                            -801,
                            34
                        ],
                        [
                            -1078,
                            35
                        ],
                        [
                            -1077,
                            249
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_114",
            "properties": {
                "name": "A.202",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1078,
                            27
                        ],
                        [
                            -803,
                            30
                        ],
                        [
                            -803,
                            -185
                        ],
                        [
                            -1078,
                            -186
                        ],
                        [
                            -1078,
                            27
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_136",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -685,
                            248
                        ],
                        [
                            -566,
                            247
                        ],
                        [
                            -567,
                            62
                        ],
                        [
                            -683,
                            63
                        ],
                        [
                            -685,
                            248
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_158",
            "properties": {
                "name": "Elevator_2",
                "description": "Elevator of floor 2." + displayUpDownMenu(1,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -688,
                            -64
                        ],
                        [
                            -546,
                            -64
                        ],
                        [
                            -547,
                            -186
                        ],
                        [
                            -688,
                            -185
                        ],
                        [
                            -688,
                            -64
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_182",
            "properties": {
                "name": "A.203",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -560,
                            249
                        ],
                        [
                            -383,
                            248
                        ],
                        [
                            -382,
                            61
                        ],
                        [
                            -561,
                            61
                        ],
                        [
                            -560,
                            249
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_204",
            "properties": {
                "name": "A.204",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -378,
                            248
                        ],
                        [
                            -198,
                            247
                        ],
                        [
                            -198,
                            63
                        ],
                        [
                            -377,
                            62
                        ],
                        [
                            -378,
                            248
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_228",
            "properties": {
                "name": "A.205",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -192,
                            249
                        ],
                        [
                            -1,
                            247
                        ],
                        [
                            -1,
                            62
                        ],
                        [
                            -193,
                            61
                        ],
                        [
                            -192,
                            249
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_250",
            "properties": {
                "name": "A.206",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            3,
                            248
                        ],
                        [
                            267,
                            248
                        ],
                        [
                            267,
                            62
                        ],
                        [
                            4,
                            62
                        ],
                        [
                            3,
                            248
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_274",
            "properties": {
                "name": "A.207",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            270,
                            249
                        ],
                        [
                            566,
                            248
                        ],
                        [
                            566,
                            62
                        ],
                        [
                            272,
                            62
                        ],
                        [
                            270,
                            249
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_298",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            571,
                            249
                        ],
                        [
                            671,
                            247
                        ],
                        [
                            671,
                            63
                        ],
                        [
                            571,
                            59
                        ],
                        [
                            571,
                            249
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_315",
            "properties": {
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            719,
                            294
                        ],
                        [
                            719,
                            293
                        ],
                        [
                            719,
                            293
                        ],
                        [
                            719,
                            294
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_341",
            "properties": {
                "name": "A.208",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            831,
                            213
                        ],
                        [
                            1084,
                            214
                        ],
                        [
                            1084,
                            -180
                        ],
                        [
                            831,
                            -181
                        ],
                        [
                            831,
                            213
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_368",
            "properties": {
                "name": "Stair_2",
                "description": "Stair of Floor 2." + displayUpDownMenu(1,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            669,
                            -190
                        ],
                        [
                            750,
                            -192
                        ],
                        [
                            749,
                            -190
                        ],
                        [
                            748,
                            -263
                        ],
                        [
                            672,
                            -263
                        ],
                        [
                            669,
                            -190
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_390",
            "properties": {
                "name": "Elevator_2",
                "description": "Elevator of floor 2." + displayUpDownMenu(1,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            526,
                            -64
                        ],
                        [
                            671,
                            -65
                        ],
                        [
                            671,
                            -179
                        ],
                        [
                            525,
                            -180
                        ],
                        [
                            526,
                            -64
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_414",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            335,
                            -65
                        ],
                        [
                            519,
                            -66
                        ],
                        [
                            522,
                            -181
                        ],
                        [
                            336,
                            -183
                        ],
                        [
                            335,
                            -65
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_436",
            "properties": {
                "name": "Technical Services",
                "description": "supplying the technical devices"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            106,
                            -64
                        ],
                        [
                            331,
                            -67
                        ],
                        [
                            332,
                            -175
                        ],
                        [
                            107,
                            -179
                        ],
                        [
                            106,
                            -64
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_460",
            "properties": {
                "name": "Students affair",
                "description": "provide students with acedemic settings resolutions. Website: <a href=\"http://oaa.hcmiu.edu.vn\" target=\"_blank\">http://oaa.hcmiu.edu.vn</a>"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -542,
                            -64
                        ],
                        [
                            -341,
                            -65
                        ],
                        [
                            -339,
                            -186
                        ],
                        [
                            -542,
                            -187
                        ],
                        [
                            -542,
                            -64
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_482",
            "properties": {
                "name": "Stair_2",
                "description": "Stair of Floor 2." + displayUpDownMenu(1,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -754,
                            -190
                        ],
                        [
                            -690,
                            -190
                        ],
                        [
                            -691,
                            -264
                        ],
                        [
                            -753,
                            -265
                        ],
                        [
                            -754,
                            -190
                        ]
                    ]
                ]
            }
        }
    ]
}
geojsonf2 = new OpenLayers.Format.GeoJSON();
vectorsf2 = new OpenLayers.Layer.Vector();
selectControlf2= new OpenLayers.Control.SelectFeature(vectorsf2,
    {onSelect: onFeatureSelectf2, onUnselect: onFeatureUnselectf2});
mapf2.addLayer(vectorsf2);
vectorsf2.addFeatures(geojsonf2.read(featurecollection));
mapf2.addControl(selectControlf2);
selectControlf2.activate();
function onPopupClosef2(){selectControlf2.unselect(selectedFeaturef2);};
function onFeatureSelectf2(feature){
    selectedFeaturef2 = feature;
    popup = new OpenLayers.Popup.FramedCloud(feature.id + "pop", feature.geometry.getBounds().getCenterLonLat(),null,"<div style='font-size:.8em'>Room: " + feature.attributes.name + "<br />Description: " + feature.attributes.description + "</div>",null, true, onPopupClosef2);
    feature.popup = popup;
    mapf2.addPopup(popup);
}
function onFeatureUnselectf2(feature){
    mapf2.removePopup(feature.popup);
    feature.popup.destroy();
    feature.popup = null;
}

///

var mapg,mposctlg,vectorsg, geojsong,markersg,selectControlg;
var selectedFeatureg;
//Init
mapg = new OpenLayers.Map('ground');
layer = new OpenLayers.Layer.Image(
    "ground",
    datapath + "ground.jpg",
    new OpenLayers.Bounds(-1227,-369.5,1227,369.5),
    new OpenLayers.Size(2454,739)
);
mapg.addLayer(layer);
mapg.zoomToMaxExtent();
var featurecollection = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_92",
            "properties": {
                "name": "Canteen",
                "description": "food and drinks for students"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1217.0205078125,
                            329.4892578125
                        ],
                        [
                            -939.0205078125,
                            329.4892578125
                        ],
                        [
                            -937.0205078125,
                            -111.5107421875
                        ],
                        [
                            -1213.0205078125,
                            -111.5107421875
                        ],
                        [
                            -1217.0205078125,
                            329.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_114",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -815.0205078125,
                            326.4892578125
                        ],
                        [
                            -699.0205078125,
                            328.4892578125
                        ],
                        [
                            -697.0205078125,
                            136.4892578125
                        ],
                        [
                            -816.0205078125,
                            135.4892578125
                        ],
                        [
                            -815.0205078125,
                            326.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_136",
            "properties": {
                "name": "Elevator_1",
                "description": "Ground elevator." + displayUpDownMenu(0,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -819.0205078125,
                            8.4892578125
                        ],
                        [
                            -678.0205078125,
                            9.4892578125
                        ],
                        [
                            -679.0205078125,
                            -110.5107421875
                        ],
                        [
                            -821.0205078125,
                            -110.5107421875
                        ],
                        [
                            -819.0205078125,
                            8.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_162",
            "properties": {
                "name": "Library",
                "description": "supplying reference books to students for studying and research"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -694.0205078125,
                            328.4892578125
                        ],
                        [
                            41.9794921875,
                            328.4892578125
                        ],
                        [
                            44.9794921875,
                            137.4892578125
                        ],
                        [
                            -694.0205078125,
                            136.4892578125
                        ],
                        [
                            -694.0205078125,
                            328.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_186",
            "properties": {
                "name": "A.103",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            48.9794921875,
                            328.4892578125
                        ],
                        [
                            408.9794921875,
                            328.4892578125
                        ],
                        [
                            410.9794921875,
                            136.4892578125
                        ],
                        [
                            49.9794921875,
                            136.4892578125
                        ],
                        [
                            48.9794921875,
                            328.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_208",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            415.9794921875,
                            329.4892578125
                        ],
                        [
                            539.9794921875,
                            327.4892578125
                        ],
                        [
                            539.9794921875,
                            135.4892578125
                        ],
                        [
                            417.9794921875,
                            133.4892578125
                        ],
                        [
                            415.9794921875,
                            329.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_234",
            "properties": {
                "name": "A.105",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            699.9794921875,
                            287.4892578125
                        ],
                        [
                            949.9794921875,
                            287.4892578125
                        ],
                        [
                            951.9794921875,
                            -104.5107421875
                        ],
                        [
                            697.9794921875,
                            -107.5107421875
                        ],
                        [
                            699.9794921875,
                            287.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_258",
            "properties": {
                "name": "Elevator_1",
                "description": "Ground elevator." + displayUpDownMenu(0,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            393.9794921875,
                            10.4892578125
                        ],
                        [
                            538.9794921875,
                            10.4892578125
                        ],
                        [
                            537.9794921875,
                            -105.5107421875
                        ],
                        [
                            392.9794921875,
                            -106.5107421875
                        ],
                        [
                            393.9794921875,
                            10.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_280",
            "properties": {
                "name": "Stair_1",
                "description": "Ground stair" + displayUpDownMenu(0,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            536.9794921875,
                            -116.5107421875
                        ],
                        [
                            617.9794921875,
                            -115.5107421875
                        ],
                        [
                            616.9794921875,
                            -188.5107421875
                        ],
                        [
                            538.9794921875,
                            -187.5107421875
                        ],
                        [
                            536.9794921875,
                            -116.5107421875
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_304",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            203.9794921875,
                            10.4892578125
                        ],
                        [
                            387.9794921875,
                            10.4892578125
                        ],
                        [
                            388.9794921875,
                            -108.5107421875
                        ],
                        [
                            204.9794921875,
                            -109.5107421875
                        ],
                        [
                            203.9794921875,
                            10.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_326",
            "properties": {
                "name": "Photocopy room",
                "description": "photocopy services"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -24.0205078125,
                            8.4892578125
                        ],
                        [
                            200.9794921875,
                            9.4892578125
                        ],
                        [
                            200.9794921875,
                            -106.5107421875
                        ],
                        [
                            -25.0205078125,
                            -106.5107421875
                        ],
                        [
                            -24.0205078125,
                            8.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_350",
            "properties": {
                "name": "Youth Union",
                "description": "the working offices of Youth union related to university indoor and outdoor activities"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -673.0205078125,
                            9.4892578125
                        ],
                        [
                            -400.0205078125,
                            9.4892578125
                        ],
                        [
                            -399.0205078125,
                            -111.5107421875
                        ],
                        [
                            -672.0205078125,
                            -111.5107421875
                        ],
                        [
                            -673.0205078125,
                            9.4892578125
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_372",
            "properties": {
                "name": "Stair_1",
                "description": "Ground stair" + displayUpDownMenu(0,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -885.0205078125,
                            -115.5107421875
                        ],
                        [
                            -823.0205078125,
                            -115.5107421875
                        ],
                        [
                            -823.0205078125,
                            -188.5107421875
                        ],
                        [
                            -885.0205078125,
                            -188.5107421875
                        ],
                        [
                            -885.0205078125,
                            -115.5107421875
                        ]
                    ]
                ]
            }
        }
    ]
}
geojsong = new OpenLayers.Format.GeoJSON();
vectorsg = new OpenLayers.Layer.Vector();
selectControlg= new OpenLayers.Control.SelectFeature(vectorsg,
    {onSelect: onFeatureSelectg, onUnselect: onFeatureUnselectg});
mapg.addLayer(vectorsg);
vectorsg.addFeatures(geojsong.read(featurecollection));
mapg.addControl(selectControlg);
selectControlg.activate();
function onPopupCloseg(){selectControlg.unselect(selectedFeatureg);};
function onFeatureSelectg(feature){
    selectedFeatureg = feature;
    popup = new OpenLayers.Popup.FramedCloud(feature.id + "pop", feature.geometry.getBounds().getCenterLonLat(),null,"<div style='font-size:.8em'>Room: " + feature.attributes.name + "<br />Description: " + feature.attributes.description + "</div>",null, true, onPopupCloseg);
    feature.popup = popup;
    mapg.addPopup(popup);
}
function onFeatureUnselectg(feature){
    mapg.removePopup(feature.popup);
    feature.popup.destroy();
    feature.popup = null;
}



///


var mapf7,mposctlf7,vectorsf7, geojsonf7,markersf7,selectControlf7;
var selectedFeaturef7;
//Init
mapf7 = new OpenLayers.Map('floor7');
layer = new OpenLayers.Layer.Image(
    "floor7",
    datapath + "floor7.jpg",
    new OpenLayers.Bounds(-1091,-282,1091,282),
    new OpenLayers.Size(2182,564)
);
mapf7.addLayer(layer);
mapf7.zoomToMaxExtent();
var featurecollection = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_94",
            "properties": {
                "name": "Biomedical & Molecular BT Lab",
                "description": "Molecular Lab of Biotechnology"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1079,
                            259
                        ],
                        [
                            -801,
                            259
                        ],
                        [
                            -801,
                            46
                        ],
                        [
                            -1079,
                            45
                        ],
                        [
                            -1079,
                            259
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_116",
            "properties": {
                "name": "Cell Biotechnology Lab",
                "description": "Cell lab of BT School"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1080,
                            42
                        ],
                        [
                            -802,
                            41
                        ],
                        [
                            -800,
                            -173
                        ],
                        [
                            -1081,
                            -174
                        ],
                        [
                            -1080,
                            42
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_140",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -683,
                            260
                        ],
                        [
                            -562,
                            260
                        ],
                        [
                            -563,
                            75
                        ],
                        [
                            -683,
                            75
                        ],
                        [
                            -683,
                            260
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_162",
            "properties": {
                "name": "Office of Finance",
                "description": "academic settings services related to school fees"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -558,
                            261
                        ],
                        [
                            -379,
                            258
                        ],
                        [
                            -381,
                            75
                        ],
                        [
                            -558,
                            74
                        ],
                        [
                            -558,
                            261
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_186",
            "properties": {
                "name": "Office of Facilities Management",
                "description": "concerning facilities affair"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -376,
                            261
                        ],
                        [
                            -196,
                            259
                        ],
                        [
                            -195,
                            74
                        ],
                        [
                            -374,
                            74
                        ],
                        [
                            -376,
                            261
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_208",
            "properties": {
                "name": "office of International Relations and R &D Management",
                "description": ""
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -191,
                            258
                        ],
                        [
                            0,
                            259
                        ],
                        [
                            -1,
                            72
                        ],
                        [
                            -190,
                            74
                        ],
                        [
                            -191,
                            258
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_230",
            "properties": {
                "name": "Rector 's office",
                "description": "the personel room of rector"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            6,
                            258
                        ],
                        [
                            181,
                            258
                        ],
                        [
                            181,
                            76
                        ],
                        [
                            4,
                            74
                        ],
                        [
                            6,
                            258
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_254",
            "properties": {
                "name": "Office of personal Administration",
                "description": ""
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            186,
                            262
                        ],
                        [
                            380,
                            259
                        ],
                        [
                            379,
                            75
                        ],
                        [
                            186,
                            74
                        ],
                        [
                            186,
                            262
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_276",
            "properties": {
                "name": "Meeting room",
                "description": "room for discussion"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            384,
                            262
                        ],
                        [
                            568,
                            261
                        ],
                        [
                            571,
                            74
                        ],
                        [
                            383,
                            75
                        ],
                        [
                            384,
                            262
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_300",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            574,
                            260
                        ],
                        [
                            674,
                            260
                        ],
                        [
                            676,
                            73
                        ],
                        [
                            572,
                            73
                        ],
                        [
                            574,
                            260
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_322",
            "properties": {
                "name": "Department of Business administration",
                "description": "the working office of BA school"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            822,
                            262
                        ],
                        [
                            1088,
                            261
                        ],
                        [
                            1088,
                            42
                        ],
                        [
                            822,
                            40
                        ],
                        [
                            822,
                            262
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_342",
            "properties": {
            },
            "geometry": {
                "type": "LineString",
                "coordinates": [
                    [
                        823,
                        35
                    ],
                    [
                        1086,
                        34
                    ],
                    [
                        1085,
                        -167
                    ],
                    [
                        1085,
                        33
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_366",
            "properties": {
                "name": "Office of Academic Affair",
                "description": "concerning academic settings related to schedules, announcements..."
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            821,
                            36
                        ],
                        [
                            1086,
                            35
                        ],
                        [
                            1087,
                            -169
                        ],
                        [
                            821,
                            -169
                        ],
                        [
                            821,
                            36
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_390",
            "properties": {
                "name": "Stair_7",
                "description": "Stair of Floor 7" + displayUpDownMenu(6,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            669,
                            -177
                        ],
                        [
                            751,
                            -176
                        ],
                        [
                            751,
                            -251
                        ],
                        [
                            673,
                            -251
                        ],
                        [
                            669,
                            -177
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_414",
            "properties": {
                "name": "Elevator_7",
                "description": "Elevator of Floor 7" + displayUpDownMenu(6,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            528,
                            -52
                        ],
                        [
                            674,
                            -53
                        ],
                        [
                            674,
                            -168
                        ],
                        [
                            526,
                            -168
                        ],
                        [
                            528,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_436",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            337,
                            -52
                        ],
                        [
                            521,
                            -53
                        ],
                        [
                            522,
                            -168
                        ],
                        [
                            337,
                            -169
                        ],
                        [
                            337,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_458",
            "properties": {
                "name": "Cleaning Services",
                "description": "provide cleaning services"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            110,
                            -54
                        ],
                        [
                            335,
                            -55
                        ],
                        [
                            336,
                            -166
                        ],
                        [
                            107,
                            -168
                        ],
                        [
                            110,
                            -54
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_494",
            "properties": {
                "name": "Vice rector's office",
                "description": ""
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -116,
                            -53
                        ],
                        [
                            103,
                            -52
                        ],
                        [
                            105,
                            -165
                        ],
                        [
                            -116,
                            -167
                        ],
                        [
                            -115,
                            -167
                        ],
                        [
                            -116,
                            -165
                        ],
                        [
                            -114,
                            -165
                        ],
                        [
                            -117,
                            -165
                        ],
                        [
                            -116,
                            -53
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_516",
            "properties": {
                "name": "Vice Rector's office",
                "description": "the working office of vice rector"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -331,
                            -53
                        ],
                        [
                            -121,
                            -54
                        ],
                        [
                            -122,
                            -167
                        ],
                        [
                            -331,
                            -169
                        ],
                        [
                            -331,
                            -53
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_538",
            "properties": {
                "name": "Vice Rector's office",
                "description": ""
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -539,
                            -53
                        ],
                        [
                            -336,
                            -54
                        ],
                        [
                            -335,
                            -168
                        ],
                        [
                            -540,
                            -167
                        ],
                        [
                            -539,
                            -53
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_562",
            "properties": {
                "name": "Stair_7",
                "description": "Stair of Floor 7" + displayUpDownMenu(6,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -754,
                            -178
                        ],
                        [
                            -694,
                            -177
                        ],
                        [
                            -693,
                            -248
                        ],
                        [
                            -752,
                            -249
                        ],
                        [
                            -754,
                            -178
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_584",
            "properties": {
                "name": "Elevator_7",
                "description": "Elevator of Floor 7" + displayUpDownMenu(6,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -686,
                            -51
                        ],
                        [
                            -542,
                            -52
                        ],
                        [
                            -544,
                            -168
                        ],
                        [
                            -688,
                            -169
                        ],
                        [
                            -686,
                            -51
                        ]
                    ]
                ]
            }
        }
    ]
}
geojsonf7 = new OpenLayers.Format.GeoJSON();
vectorsf7 = new OpenLayers.Layer.Vector();
selectControlf7= new OpenLayers.Control.SelectFeature(vectorsf7,
    {onSelect: onFeatureSelectf7, onUnselect: onFeatureUnselectf7});
mapf7.addLayer(vectorsf7);
vectorsf7.addFeatures(geojsonf7.read(featurecollection));
mapf7.addControl(selectControlf7);
selectControlf7.activate();
function onPopupClosef7(){selectControlf7.unselect(selectedFeaturef7);};
function onFeatureSelectf7(feature){
    selectedFeaturef7 = feature;
    popup = new OpenLayers.Popup.FramedCloud(feature.id + "pop", feature.geometry.getBounds().getCenterLonLat(),null,"<div style='font-size:.8em'>Room: " + feature.attributes.name + "<br />Description: " + feature.attributes.description + "</div>",null, true, onPopupClosef7);
    feature.popup = popup;
    mapf7.addPopup(popup);
}
function onFeatureUnselectf7(feature){
    mapf7.removePopup(feature.popup);
    feature.popup.destroy();
    feature.popup = null;
}



///


var mapf6,mposctlf6,vectorsf6, geojsonf6,markersf6,selectControlf6;
var selectedFeaturef6;
//Init
mapf6 = new OpenLayers.Map('floor6');
layer = new OpenLayers.Layer.Image(
    "floor6",
    datapath + "floor6.jpg",
    new OpenLayers.Bounds(-1091,-282,1091,282),
    new OpenLayers.Size(2182,564)
);
mapf6.addLayer(layer);
mapf6.zoomToMaxExtent();
var featurecollection = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_92",
            "properties": {
                "name": "Electronic lab",
                "description": "Lab room for EE students"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1080,
                            260
                        ],
                        [
                            -799,
                            259
                        ],
                        [
                            -801,
                            46
                        ],
                        [
                            -1081,
                            46
                        ],
                        [
                            -1080,
                            260
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_114",
            "properties": {
                "name": "Communication Lab",
                "description": "lab room for communication"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1081,
                            43
                        ],
                        [
                            -800,
                            41
                        ],
                        [
                            -801,
                            -172
                        ],
                        [
                            -1081,
                            -173
                        ],
                        [
                            -1081,
                            43
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_136",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -683,
                            260
                        ],
                        [
                            -564,
                            259
                        ],
                        [
                            -564,
                            75
                        ],
                        [
                            -682,
                            74
                        ],
                        [
                            -683,
                            260
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_158",
            "properties": {
                "name": "Elevator_6",
                "description": "Elevator of Floor 6" + displayUpDownMenu(5,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -685,
                            -52
                        ],
                        [
                            -545,
                            -53
                        ],
                        [
                            -544,
                            -166
                        ],
                        [
                            -687,
                            -169
                        ],
                        [
                            -685,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_182",
            "properties": {
                "name": "A.603",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -558,
                            259
                        ],
                        [
                            -378,
                            260
                        ],
                        [
                            -380,
                            73
                        ],
                        [
                            -559,
                            73
                        ],
                        [
                            -558,
                            259
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_219",
            "properties": {
                "name": "Simulation Lab",
                "description": "Lab room for Simulation"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -374,
                            259
                        ],
                        [
                            -196,
                            258
                        ],
                        [
                            -196,
                            74
                        ],
                        [
                            -373,
                            74
                        ],
                        [
                            -374,
                            259
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_241",
            "properties": {
                "name": "Databe lab",
                "description": "Lab room for database for IT students"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -189,
                            260
                        ],
                        [
                            0,
                            258
                        ],
                        [
                            -1,
                            74
                        ],
                        [
                            -189,
                            74
                        ],
                        [
                            -189,
                            260
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_265",
            "properties": {
                "name": "Computer Networking Lab",
                "description": "Lab room for computer network"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            4,
                            260
                        ],
                        [
                            182,
                            259
                        ],
                        [
                            180,
                            74
                        ],
                        [
                            6,
                            74
                        ],
                        [
                            4,
                            260
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_287",
            "properties": {
                "name": "Operating system Lab",
                "description": "Lab room for operaing system"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            188,
                            261
                        ],
                        [
                            381,
                            261
                        ],
                        [
                            380,
                            74
                        ],
                        [
                            187,
                            74
                        ],
                        [
                            188,
                            261
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_311",
            "properties": {
                "name": "Software engineering Lab",
                "description": "Lab room for software engineering"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            383,
                            262
                        ],
                        [
                            568,
                            261
                        ],
                        [
                            569,
                            73
                        ],
                        [
                            384,
                            74
                        ],
                        [
                            383,
                            262
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_333",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            572,
                            262
                        ],
                        [
                            671,
                            260
                        ],
                        [
                            673,
                            74
                        ],
                        [
                            575,
                            75
                        ],
                        [
                            572,
                            262
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_357",
            "properties": {
                "name": "Department of Electrical engineering",
                "description": "the working office of EE school"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            821,
                            263
                        ],
                        [
                            1087,
                            260
                        ],
                        [
                            1086,
                            40
                        ],
                        [
                            821,
                            40
                        ],
                        [
                            821,
                            263
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_379",
            "properties": {
                "name": "Department of Computer science and Egnineering ",
                "description": "the working office of IT school"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            821,
                            35
                        ],
                        [
                            1085,
                            36
                        ],
                        [
                            1085,
                            -167
                        ],
                        [
                            821,
                            -169
                        ],
                        [
                            821,
                            35
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_403",
            "properties": {
                "name": "Stair_6",
                "description": "Stair of Floor 6" + displayUpDownMenu(5,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            672,
                            -178
                        ],
                        [
                            751,
                            -178
                        ],
                        [
                            751,
                            -250
                        ],
                        [
                            674,
                            -251
                        ],
                        [
                            672,
                            -178
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_425",
            "properties": {
                "name": "Elevator_6",
                "description": "Elevator of Floor 6" + displayUpDownMenu(5,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            528,
                            -52
                        ],
                        [
                            674,
                            -53
                        ],
                        [
                            675,
                            -169
                        ],
                        [
                            527,
                            -169
                        ],
                        [
                            528,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_447",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            339,
                            -50
                        ],
                        [
                            521,
                            -53
                        ],
                        [
                            522,
                            -171
                        ],
                        [
                            339,
                            -172
                        ],
                        [
                            339,
                            -50
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_471",
            "properties": {
                "name": "Project Administration office",
                "description": "project Admin concerns"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            108,
                            -54
                        ],
                        [
                            334,
                            -54
                        ],
                        [
                            333,
                            -167
                        ],
                        [
                            108,
                            -167
                        ],
                        [
                            108,
                            -54
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_493",
            "properties": {
                "name": "Meeting room of EE school",
                "description": "for meeting and discussion of EE school"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -116,
                            -54
                        ],
                        [
                            103,
                            -53
                        ],
                        [
                            104,
                            -168
                        ],
                        [
                            -116,
                            -169
                        ],
                        [
                            -116,
                            -54
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_517",
            "properties": {
                "name": "Office of media and pubic relations",
                "description": "concerning media-public relations activities"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -331,
                            -53
                        ],
                        [
                            -120,
                            -54
                        ],
                        [
                            -122,
                            -168
                        ],
                        [
                            -331,
                            -169
                        ],
                        [
                            -331,
                            -53
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_539",
            "properties": {
                "name": "Quality management center",
                "description": "concerning the quality"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -541,
                            -52
                        ],
                        [
                            -336,
                            -54
                        ],
                        [
                            -336,
                            -168
                        ],
                        [
                            -540,
                            -167
                        ],
                        [
                            -541,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_576",
            "properties": {
                "name": "Stair_6",
                "description": "Stair of Floor 6" + displayUpDownMenu(5,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -755,
                            -178
                        ],
                        [
                            -689,
                            -179
                        ],
                        [
                            -689,
                            -249
                        ],
                        [
                            -756,
                            -249
                        ],
                        [
                            -755,
                            -178
                        ]
                    ]
                ]
            }
        }
    ]
}
geojsonf6 = new OpenLayers.Format.GeoJSON();
vectorsf6 = new OpenLayers.Layer.Vector();
selectControlf6= new OpenLayers.Control.SelectFeature(vectorsf6,
    {onSelect: onFeatureSelectf6, onUnselect: onFeatureUnselectf6});
mapf6.addLayer(vectorsf6);
vectorsf6.addFeatures(geojsonf6.read(featurecollection));
mapf6.addControl(selectControlf6);
selectControlf6.activate();
function onPopupClosef6(){selectControlf6.unselect(selectedFeaturef6);};
function onFeatureSelectf6(feature){
    selectedFeaturef6 = feature;
    popup = new OpenLayers.Popup.FramedCloud(feature.id + "pop", feature.geometry.getBounds().getCenterLonLat(),null,"<div style='font-size:.8em'>Room: " + feature.attributes.name + "<br />Description: " + feature.attributes.description + "</div>",null, true, onPopupClosef6);
    feature.popup = popup;
    mapf6.addPopup(popup);
}
function onFeatureUnselectf6(feature){
    mapf6.removePopup(feature.popup);
    feature.popup.destroy();
    feature.popup = null;
}



///



var mapf5,mposctlf5,vectorsf5, geojsonf5,markersf5,selectControlf5;
var selectedFeaturef5;
//Init
mapf5 = new OpenLayers.Map('floor5');
layer = new OpenLayers.Layer.Image(
    "floor5",
    datapath + "floor5.jpg",
    new OpenLayers.Bounds(-1091,-282,1091,282),
    new OpenLayers.Size(2182,564)
);
mapf5.addLayer(layer);
mapf5.zoomToMaxExtent();
var featurecollection = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_92",
            "properties": {
                "name": "Biomedical Engineering Lab",
                "description": "Lab room for BME Students"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1082,
                            262
                        ],
                        [
                            -799,
                            259
                        ],
                        [
                            -800,
                            48
                        ],
                        [
                            -1081,
                            47
                        ],
                        [
                            -1082,
                            262
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_114",
            "properties": {
                "name": "Biotechnology office",
                "description": "the working office of BT school"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1081,
                            41
                        ],
                        [
                            -801,
                            40
                        ],
                        [
                            -802,
                            -173
                        ],
                        [
                            -1082,
                            -174
                        ],
                        [
                            -1081,
                            41
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_136",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -684,
                            261
                        ],
                        [
                            -564,
                            259
                        ],
                        [
                            -564,
                            73
                        ],
                        [
                            -684,
                            72
                        ],
                        [
                            -684,
                            261
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_158",
            "properties": {
                "name": "Elevator_5",
                "description": "Elevator of Floor 5" + displayUpDownMenu(4,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -687,
                            -51
                        ],
                        [
                            -546,
                            -54
                        ],
                        [
                            -545,
                            -168
                        ],
                        [
                            -688,
                            -168
                        ],
                        [
                            -687,
                            -51
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_182",
            "properties": {
                "name": "Stair_5",
                "description": "Stair of Floor 5" + displayUpDownMenu(4,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -754,
                            -176
                        ],
                        [
                            -693,
                            -178
                        ],
                        [
                            -693,
                            -249
                        ],
                        [
                            -754,
                            -251
                        ],
                        [
                            -754,
                            -176
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_204",
            "properties": {
                "name": "Department of Industrial System Engineering/ Department of Physics",
                "description": "the working office of ISE and Physics School"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -540,
                            -52
                        ],
                        [
                            -335,
                            -53
                        ],
                        [
                            -336,
                            -168
                        ],
                        [
                            -542,
                            -169
                        ],
                        [
                            -540,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_228",
            "properties": {
                "name": "A.503",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -560,
                            260
                        ],
                        [
                            -378,
                            260
                        ],
                        [
                            -377,
                            74
                        ],
                        [
                            -559,
                            74
                        ],
                        [
                            -560,
                            260
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_250",
            "properties": {
                "name": "A.504",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -375,
                            261
                        ],
                        [
                            -197,
                            260
                        ],
                        [
                            -195,
                            74
                        ],
                        [
                            -375,
                            74
                        ],
                        [
                            -375,
                            261
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_274",
            "properties": {
                "name": "A.505",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -192,
                            260
                        ],
                        [
                            -1,
                            260
                        ],
                        [
                            0,
                            72
                        ],
                        [
                            -191,
                            73
                        ],
                        [
                            -192,
                            260
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_296",
            "properties": {
                "name": "A.506",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            4,
                            259
                        ],
                        [
                            181,
                            259
                        ],
                        [
                            181,
                            73
                        ],
                        [
                            4,
                            73
                        ],
                        [
                            4,
                            259
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_318",
            "properties": {
                "name": "Professors' office",
                "description": "the working office of all professors"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -331,
                            -52
                        ],
                        [
                            -122,
                            -54
                        ],
                        [
                            -121,
                            -167
                        ],
                        [
                            -332,
                            -167
                        ],
                        [
                            -331,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_340",
            "properties": {
                "name": "Department of Mathematics",
                "description": "the working office of Mathematics school"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -116,
                            -52
                        ],
                        [
                            104,
                            -52
                        ],
                        [
                            105,
                            -167
                        ],
                        [
                            -117,
                            -167
                        ],
                        [
                            -116,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_364",
            "properties": {
                "name": "A.507",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            186,
                            263
                        ],
                        [
                            380,
                            262
                        ],
                        [
                            379,
                            74
                        ],
                        [
                            188,
                            74
                        ],
                        [
                            186,
                            263
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_386",
            "properties": {
                "name": "Cleaning Services",
                "description": "supplying the cleaning services for the university"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            108,
                            -52
                        ],
                        [
                            335,
                            -53
                        ],
                        [
                            335,
                            -167
                        ],
                        [
                            110,
                            -168
                        ],
                        [
                            108,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_410",
            "properties": {
                "name": "A.508",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            383,
                            260
                        ],
                        [
                            569,
                            260
                        ],
                        [
                            570,
                            73
                        ],
                        [
                            385,
                            74
                        ],
                        [
                            383,
                            260
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_432",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            338,
                            -54
                        ],
                        [
                            521,
                            -54
                        ],
                        [
                            520,
                            -170
                        ],
                        [
                            342,
                            -172
                        ],
                        [
                            338,
                            -54
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_454",
            "properties": {
                "name": "Elevator_5",
                "description": "Elevator of Floor 5" + displayUpDownMenu(4,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            527,
                            -52
                        ],
                        [
                            673,
                            -54
                        ],
                        [
                            673,
                            -168
                        ],
                        [
                            526,
                            -169
                        ],
                        [
                            527,
                            -52
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_493",
            "properties": {
                "name": "Language Lab",
                "description": "for students praticing speaking and listening for English Department"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            818,
                            261
                        ],
                        [
                            1087,
                            261
                        ],
                        [
                            1086,
                            41
                        ],
                        [
                            822,
                            42
                        ],
                        [
                            818,
                            261
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_517",
            "properties": {
                "name": "Department of English/ Writing Center",
                "description": "the working office of English Department"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            821,
                            34
                        ],
                        [
                            1084,
                            36
                        ],
                        [
                            1086,
                            -169
                        ],
                        [
                            821,
                            -169
                        ],
                        [
                            821,
                            34
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_539",
            "properties": {
                "name": "Stair_5",
                "description": "Stair of Floor 5" + displayUpDownMenu(4,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            675,
                            -174
                        ],
                        [
                            753,
                            -174
                        ],
                        [
                            753,
                            -252
                        ],
                        [
                            674,
                            -250
                        ],
                        [
                            675,
                            -174
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_563",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            573,
                            260
                        ],
                        [
                            671,
                            260
                        ],
                        [
                            673,
                            74
                        ],
                        [
                            575,
                            74
                        ],
                        [
                            573,
                            260
                        ]
                    ]
                ]
            }
        }
    ]
}
geojsonf5 = new OpenLayers.Format.GeoJSON();
vectorsf5 = new OpenLayers.Layer.Vector();
selectControlf5= new OpenLayers.Control.SelectFeature(vectorsf5,
    {onSelect: onFeatureSelectf5, onUnselect: onFeatureUnselectf5});
mapf5.addLayer(vectorsf5);
vectorsf5.addFeatures(geojsonf5.read(featurecollection));
mapf5.addControl(selectControlf5);
selectControlf5.activate();
function onPopupClosef5(){selectControlf5.unselect(selectedFeaturef5);};
function onFeatureSelectf5(feature){
    selectedFeaturef5 = feature;
    popup = new OpenLayers.Popup.FramedCloud(feature.id + "pop", feature.geometry.getBounds().getCenterLonLat(),null,"<div style='font-size:.8em'>Room: " + feature.attributes.name + "<br />Description: " + feature.attributes.description + "</div>",null, true, onPopupClosef5);
    feature.popup = popup;
    mapf5.addPopup(popup);
}
function onFeatureUnselectf5(feature){
    mapf5.removePopup(feature.popup);
    feature.popup.destroy();
    feature.popup = null;
}



///


var mapf4,mposctlf4,vectorsf4, geojsonf4,markersf4,selectControlf4;
var selectedFeaturef4;
//Init
mapf4 = new OpenLayers.Map('floor4');
layer = new OpenLayers.Layer.Image(
    "floor4",
    datapath + "floor4.jpg",
    new OpenLayers.Bounds(-1105.5,-290,1105.5,290),
    new OpenLayers.Size(2211,580)
);
mapf4.addLayer(layer);
mapf4.zoomToMaxExtent();
var featurecollection = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_92",
            "properties": {
                "name": "A.402",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1072,
                            256
                        ],
                        [
                            -794,
                            255
                        ],
                        [
                            -793,
                            39
                        ],
                        [
                            -1068,
                            38
                        ],
                        [
                            -1072,
                            256
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_114",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -676,
                            255
                        ],
                        [
                            -556,
                            253
                        ],
                        [
                            -557,
                            65
                        ],
                        [
                            -676,
                            66
                        ],
                        [
                            -676,
                            255
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_138",
            "properties": {
                "name": "A.403",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -553,
                            254
                        ],
                        [
                            -373,
                            254
                        ],
                        [
                            -374,
                            67
                        ],
                        [
                            -551,
                            66
                        ],
                        [
                            -553,
                            254
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_160",
            "properties": {
                "name": "A.404",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -368,
                            253
                        ],
                        [
                            -190,
                            253
                        ],
                        [
                            -189,
                            65
                        ],
                        [
                            -368,
                            66
                        ],
                        [
                            -368,
                            253
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_184",
            "properties": {
                "name": "Biomedical engineering - Student Lab",
                "description": "lab room for BME students"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -182,
                            253
                        ],
                        [
                            7,
                            252
                        ],
                        [
                            6,
                            67
                        ],
                        [
                            -184,
                            65
                        ],
                        [
                            -182,
                            253
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_206",
            "properties": {
                "name": "A.406",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            12,
                            253
                        ],
                        [
                            190,
                            253
                        ],
                        [
                            191,
                            67
                        ],
                        [
                            12,
                            66
                        ],
                        [
                            12,
                            253
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_230",
            "properties": {
                "name": "A.407",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            195,
                            254
                        ],
                        [
                            386,
                            252
                        ],
                        [
                            388,
                            66
                        ],
                        [
                            194,
                            66
                        ],
                        [
                            195,
                            254
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_252",
            "properties": {
                "name": "A.408",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            391,
                            253
                        ],
                        [
                            576,
                            252
                        ],
                        [
                            575,
                            66
                        ],
                        [
                            392,
                            67
                        ],
                        [
                            391,
                            253
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_276",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            581,
                            251
                        ],
                        [
                            677,
                            252
                        ],
                        [
                            680,
                            66
                        ],
                        [
                            582,
                            65
                        ],
                        [
                            581,
                            251
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_300",
            "properties": {
                "name": "A.409",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            841,
                            216
                        ],
                        [
                            1094,
                            217
                        ],
                        [
                            1093,
                            -176
                        ],
                        [
                            840,
                            -176
                        ],
                        [
                            841,
                            216
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_324",
            "properties": {
                "name": "Stair_4",
                "description": "Stair of Floor 4" + displayUpDownMenu(3,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            678,
                            -185
                        ],
                        [
                            758,
                            -186
                        ],
                        [
                            757,
                            -257
                        ],
                        [
                            683,
                            -259
                        ],
                        [
                            678,
                            -185
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_350",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            346,
                            -61
                        ],
                        [
                            528,
                            -60
                        ],
                        [
                            527,
                            -177
                        ],
                        [
                            348,
                            -177
                        ],
                        [
                            346,
                            -61
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_372",
            "properties": {
                "name": "Elevator_4",
                "description": "elevator of Floor 4" + displayUpDownMenu(3,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            534,
                            -62
                        ],
                        [
                            679,
                            -61
                        ],
                        [
                            680,
                            -177
                        ],
                        [
                            535,
                            -177
                        ],
                        [
                            534,
                            -62
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_396",
            "properties": {
                "name": "Technical Services",
                "description": "supplying technical devices"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            117,
                            -61
                        ],
                        [
                            342,
                            -64
                        ],
                        [
                            342,
                            -170
                        ],
                        [
                            116,
                            -175
                        ],
                        [
                            117,
                            -61
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_418",
            "properties": {
                "name": "Biomedical Engineering Department - Prof Vo Van Toi office",
                "description": "personal office of Prof Vo Van Toi"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -109,
                            -61
                        ],
                        [
                            112,
                            -62
                        ],
                        [
                            110,
                            -175
                        ],
                        [
                            -110,
                            -176
                        ],
                        [
                            -109,
                            -61
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_442",
            "properties": {
                "name": "Department of Biomedical Engineering ",
                "description": "the working office of BME school"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -335,
                            -61
                        ],
                        [
                            -115,
                            -61
                        ],
                        [
                            -115,
                            -174
                        ],
                        [
                            -335,
                            -175
                        ],
                        [
                            -335,
                            -61
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_464",
            "properties": {
                "name": "A.413",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -532,
                            -60
                        ],
                        [
                            -341,
                            -61
                        ],
                        [
                            -340,
                            -175
                        ],
                        [
                            -532,
                            -176
                        ],
                        [
                            -532,
                            -60
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_486",
            "properties": {
                "name": "Elevator_4",
                "description": "elevator of Floor 4" + displayUpDownMenu(3,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -677,
                            -61
                        ],
                        [
                            -539,
                            -61
                        ],
                        [
                            -538,
                            -176
                        ],
                        [
                            -681,
                            -178
                        ],
                        [
                            -677,
                            -61
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_510",
            "properties": {
                "name": "A.401",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1068,
                            32
                        ],
                        [
                            -796,
                            32
                        ],
                        [
                            -797,
                            -179
                        ],
                        [
                            -1067,
                            -179
                        ],
                        [
                            -1068,
                            32
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_532",
            "properties": {
                "name": "Stair_4",
                "description": "Stair of Floor 4" + displayUpDownMenu(3,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -746,
                            -187
                        ],
                        [
                            -686,
                            -188
                        ],
                        [
                            -686,
                            -256
                        ],
                        [
                            -745,
                            -257
                        ],
                        [
                            -746,
                            -187
                        ]
                    ]
                ]
            }
        }
    ]
}
geojsonf4 = new OpenLayers.Format.GeoJSON();
vectorsf4 = new OpenLayers.Layer.Vector();
selectControlf4= new OpenLayers.Control.SelectFeature(vectorsf4,
    {onSelect: onFeatureSelectf4, onUnselect: onFeatureUnselectf4});
mapf4.addLayer(vectorsf4);
vectorsf4.addFeatures(geojsonf4.read(featurecollection));
mapf4.addControl(selectControlf4);
selectControlf4.activate();
function onPopupClosef4(){selectControlf4.unselect(selectedFeaturef4);};
function onFeatureSelectf4(feature){
    selectedFeaturef4 = feature;
    popup = new OpenLayers.Popup.FramedCloud(feature.id + "pop", feature.geometry.getBounds().getCenterLonLat(),null,"<div style='font-size:.8em'>Room: " + feature.attributes.name + "<br />Description: " + feature.attributes.description + "</div>",null, true, onPopupClosef4);
    feature.popup = popup;
    mapf4.addPopup(popup);
}
function onFeatureUnselectf4(feature){
    mapf4.removePopup(feature.popup);
    feature.popup.destroy();
    feature.popup = null;
}



///



var mapf3,mposctlf3,vectorsf3, geojsonf3,markersf3,selectControlf3;
var selectedFeaturef3;
//Init
mapf3 = new OpenLayers.Map('floor3');
layer = new OpenLayers.Layer.Image(
    "floor3",
    datapath + "floor3.jpg",
    new OpenLayers.Bounds(-1105.5,-290,1105.5,290),
    new OpenLayers.Size(2211,580)
);
mapf3.addLayer(layer);
mapf3.zoomToMaxExtent();
var featurecollection = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_92",
            "properties": {
                "name": "A.302",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1073,
                            255
                        ],
                        [
                            -794,
                            254
                        ],
                        [
                            -794,
                            38
                        ],
                        [
                            -1068,
                            36
                        ],
                        [
                            -1073,
                            255
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_117",
            "properties": {
                "name": "Computer lab room",
                "description": "computers available for students usage"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -1069,
                            32
                        ],
                        [
                            -797,
                            33
                        ],
                        [
                            -797,
                            -179
                        ],
                        [
                            -1066,
                            -178
                        ],
                        [
                            -1065,
                            -178
                        ],
                        [
                            -1069,
                            32
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_139",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -675,
                            255
                        ],
                        [
                            -556,
                            254
                        ],
                        [
                            -557,
                            66
                        ],
                        [
                            -675,
                            66
                        ],
                        [
                            -675,
                            255
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_161",
            "properties": {
                "name": "Elevator_3",
                "description": "Elevator of floor 3" + displayUpDownMenu(2,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -680,
                            -61
                        ],
                        [
                            -537,
                            -60
                        ],
                        [
                            -538,
                            -177
                        ],
                        [
                            -679,
                            -177
                        ],
                        [
                            -680,
                            -61
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_185",
            "properties": {
                "name": "A.303",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -551,
                            254
                        ],
                        [
                            -373,
                            253
                        ],
                        [
                            -372,
                            64
                        ],
                        [
                            -553,
                            65
                        ],
                        [
                            -551,
                            254
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_207",
            "properties": {
                "name": "A.313",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -534,
                            -60
                        ],
                        [
                            -340,
                            -61
                        ],
                        [
                            -340,
                            -173
                        ],
                        [
                            -533,
                            -176
                        ],
                        [
                            -534,
                            -60
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_231",
            "properties": {
                "name": "A.304",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -367,
                            254
                        ],
                        [
                            -188,
                            254
                        ],
                        [
                            -188,
                            66
                        ],
                        [
                            -367,
                            67
                        ],
                        [
                            -367,
                            254
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_253",
            "properties": {
                "name": "A.305",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -183,
                            253
                        ],
                        [
                            8,
                            253
                        ],
                        [
                            8,
                            65
                        ],
                        [
                            -182,
                            66
                        ],
                        [
                            -183,
                            253
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_277",
            "properties": {
                "name": "A.306",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            11,
                            254
                        ],
                        [
                            192,
                            253
                        ],
                        [
                            190,
                            67
                        ],
                        [
                            12,
                            65
                        ],
                        [
                            11,
                            254
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_299",
            "properties": {
                "name": "A.307",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            195,
                            254
                        ],
                        [
                            386,
                            252
                        ],
                        [
                            386,
                            65
                        ],
                        [
                            195,
                            65
                        ],
                        [
                            195,
                            254
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_323",
            "properties": {
                "name": "A.308",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            392,
                            253
                        ],
                        [
                            574,
                            253
                        ],
                        [
                            576,
                            65
                        ],
                        [
                            390,
                            66
                        ],
                        [
                            392,
                            253
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_345",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            580,
                            253
                        ],
                        [
                            678,
                            253
                        ],
                        [
                            680,
                            65
                        ],
                        [
                            582,
                            65
                        ],
                        [
                            580,
                            253
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_369",
            "properties": {
                "name": "A.309",
                "description": "Auditorium"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            841,
                            216
                        ],
                        [
                            1092,
                            215
                        ],
                        [
                            1093,
                            -176
                        ],
                        [
                            839,
                            -176
                        ],
                        [
                            841,
                            216
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_393",
            "properties": {
                "name": "Stair_3",
                "description": "Stair of Floor 3" + displayUpDownMenu(2,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            678,
                            -186
                        ],
                        [
                            756,
                            -188
                        ],
                        [
                            758,
                            -258
                        ],
                        [
                            680,
                            -259
                        ],
                        [
                            678,
                            -186
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_415",
            "properties": {
                "name": "Elevator_3",
                "description": "Elevator of Floor 3" + displayUpDownMenu(2,false)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            535,
                            -61
                        ],
                        [
                            679,
                            -60
                        ],
                        [
                            680,
                            -178
                        ],
                        [
                            533,
                            -178
                        ],
                        [
                            535,
                            -61
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_437",
            "properties": {
                "name": "WC",
                "description": "Restroom"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            345,
                            -60
                        ],
                        [
                            529,
                            -62
                        ],
                        [
                            528,
                            -177
                        ],
                        [
                            346,
                            -180
                        ],
                        [
                            345,
                            -60
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_461",
            "properties": {
                "name": "University Cinic",
                "description": "University medical treatment"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            117,
                            -61
                        ],
                        [
                            341,
                            -60
                        ],
                        [
                            342,
                            -176
                        ],
                        [
                            116,
                            -177
                        ],
                        [
                            117,
                            -61
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_483",
            "properties": {
                "name": "Server room",
                "description": "server room"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -110,
                            -61
                        ],
                        [
                            110,
                            -61
                        ],
                        [
                            111,
                            -176
                        ],
                        [
                            -108,
                            -178
                        ],
                        [
                            -110,
                            -61
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_507",
            "properties": {
                "name": "Computer Service center",
                "description": "controlling the computer system"
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -336,
                            -62
                        ],
                        [
                            -115,
                            -61
                        ],
                        [
                            -115,
                            -176
                        ],
                        [
                            -336,
                            -176
                        ],
                        [
                            -336,
                            -62
                        ]
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "OpenLayers.Feature.Vector_531",
            "properties": {
                "name": "Stair_3",
                "description": "Stair of Floor 3" + displayUpDownMenu(2,true)
            },
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            -748,
                            -185
                        ],
                        [
                            -686,
                            -186
                        ],
                        [
                            -686,
                            -255
                        ],
                        [
                            -748,
                            -256
                        ],
                        [
                            -748,
                            -185
                        ]
                    ]
                ]
            }
        }
    ]
}
geojsonf3 = new OpenLayers.Format.GeoJSON();
vectorsf3 = new OpenLayers.Layer.Vector();
selectControlf3= new OpenLayers.Control.SelectFeature(vectorsf3,
    {onSelect: onFeatureSelectf3, onUnselect: onFeatureUnselectf3});
mapf3.addLayer(vectorsf3);
vectorsf3.addFeatures(geojsonf3.read(featurecollection));
mapf3.addControl(selectControlf3);
selectControlf3.activate();
function onPopupClosef3(){selectControlf3.unselect(selectedFeaturef3);};
function onFeatureSelectf3(feature){
    selectedFeaturef3 = feature;
    popup = new OpenLayers.Popup.FramedCloud(feature.id + "pop", feature.geometry.getBounds().getCenterLonLat(),null,"<div style='font-size:.8em'>Room: " + feature.attributes.name + "<br />Description: " + feature.attributes.description + "</div>",null, true, onPopupClosef3);
    feature.popup = popup;
    mapf3.addPopup(popup);
}
function onFeatureUnselectf3(feature){
    mapf3.removePopup(feature.popup);
    feature.popup.destroy();
    feature.popup = null;
}

</script>
